package com.example.student;

import java.io.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;

@WebServlet(name = "helloServlet", value = "/hello-servlet")
public class HelloServlet extends HttpServlet {
    private String message;

    public void init() {
        message = "Hello World!";
    }


    protected void doPost(HttpServletRequest request ,HttpServletResponse response) throws IOException {
        String username = request.getParameter("username");
        String userage = request.getParameter("userage");
        String telnum = request.getParameter("telnum");
        PrintWriter out = response.getWriter();
        out.println("username="+username+","+"userage="+userage+",telnum"+telnum);
        Student stu = new Student(username,userage,telnum);
        stu.show();

    }

    public void destroy() {
    }
}